package com.example.myapplication.soaprequest.request

import android.os.Parcel
import android.os.Parcelable
import org.simpleframework.xml.Element
import org.simpleframework.xml.Root

@Root(name = "jhrwzdy", strict = false)
class CustomerManagerListRequest() : BaseRequest(), Parcelable {
    @field:Element(name = "types", required = false)
    var types: String = "" // 单位类型

    @field:Element(name = "dwmc", required = false)
    var dwmc: String = "" // 单位名称

    @field:Element(name = "lxrname", required = false)
    var lxrname: String = "" // 联系人姓名

    @field:Element(name = "phone", required = false)
    var phone: String = "" // 固定电话

    @field:Element(name = "qq", required = false)
    var qq: String = "" // qq

    @field:Element(name = "xmjd", required = false)
    var xmjd: String = "" // 项目进度id 如果是-1全部（包括无进度的） 0表示全部进度（只考虑有进度的）

    @field:Element(name = "zt", required = false)
    var zt: String = ""  // -1 全部 0未拜访 1已拜访

    @field:Element(name = "qsrq", required = false)
    var qsrq: String = "" // 拜访起始日期

    @field:Element(name = "zzrq", required = false)
    var zzrq: String = "" // 拜访截止日期

    @field:Element(name = "typeid", required = false)
    // 客户等级 ( 客户和渠道取字典 zdbm=’KHDJ’;供应商取字典zdbm=’GYSDJ’;对手取字典zdbm=’DSDJ’;物流取字典zdbm=’WLDJ’; 员工没有等级)
    var typeid: String = ""

    @field:Element(name = "areaid", required = false)
    var areaid: String = "" // 省ID

    @field:Element(name = "cityid", required = false)
    var cityid: String = "" // 市ID

    @field:Element(name = "countyid", required = false)
    var countyid: String = ""  // 县区ID

    @field:Element(name = "areatypeid", required = false)
    var areatypeid: String = ""  // 区域ID

    @field:Element(name = "curpage", required = false)
    var curpage: String = "1" // 当前页号

    @field:Element(name = "pagesize", required = false)
    var pagesize: String = "25"  // 每页行数

    constructor(parcel: Parcel) : this() {
        types = parcel.readString() ?: ""
        dwmc = parcel.readString() ?: ""
        lxrname = parcel.readString() ?: ""
        phone = parcel.readString() ?: ""
        qq = parcel.readString() ?: ""
        xmjd = parcel.readString() ?: ""
        zt = parcel.readString() ?: ""
        qsrq = parcel.readString() ?: ""
        zzrq = parcel.readString() ?: ""
        typeid = parcel.readString() ?: ""
        areaid = parcel.readString() ?: ""
        cityid = parcel.readString() ?: ""
        countyid = parcel.readString() ?: ""
        areatypeid = parcel.readString() ?: ""
        curpage = parcel.readString() ?: ""
        pagesize = parcel.readString() ?: ""
    }

    override fun writeToParcel(parcel: Parcel, flags: Int) {
        parcel.writeString(types)
        parcel.writeString(dwmc)
        parcel.writeString(lxrname)
        parcel.writeString(phone)
        parcel.writeString(qq)
        parcel.writeString(xmjd)
        parcel.writeString(zt)
        parcel.writeString(qsrq)
        parcel.writeString(zzrq)
        parcel.writeString(typeid)
        parcel.writeString(areaid)
        parcel.writeString(cityid)
        parcel.writeString(countyid)
        parcel.writeString(areatypeid)
        parcel.writeString(curpage)
        parcel.writeString(pagesize)
    }

    override fun describeContents(): Int {
        return 0
    }

    companion object CREATOR : Parcelable.Creator<CustomerManagerListRequest> {
        override fun createFromParcel(parcel: Parcel): CustomerManagerListRequest {
            return CustomerManagerListRequest(parcel)
        }

        override fun newArray(size: Int): Array<CustomerManagerListRequest?> {
            return arrayOfNulls(size)
        }
    }

}